package com.aier.common.action;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.aier.common.common.CommonSession;

@Scope("prototype")
@Component("commonPersonalHeadAction")
public class CommonPersonalHeadAction extends CommonBaseAction {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    // 普通用户
    private Integer ut;
    // 家庭用户
    private Integer ht;
    // 教师用户
    private Integer tt;
    // 学校管理员用户
    private Integer st;
    // 代理商用户
    private Integer pt;

    // 代理商id与名称
    private List<String[]> tl;

    // 学校ID与名称
    private List<String[]> sl;

    // 教师ID与名称
    private List<String[]> tea;
    //教师id
    private Long tid;
    
    

    /**
     * 
     * @return 普通用户,家庭,教师,学校管理,代理商
     */
    @Override
    @SuppressWarnings("unchecked")
    public String execute() {
        // 是普通用户
        ut = (Integer) session.get(CommonSession.SESSION_ACCOUNT_IDENTITY_USER);
        // 是家庭用户
        ht = (Integer) session.get(CommonSession.SESSION_ACCOUNT_IDENTITY_HOME);
        // 是教师用户
        tt = (Integer) session
                .get(CommonSession.SESSION_ACCOUNT_IDENTITY_TEACHER);
        if (null != tt && 1 == tt) {
            tea = (List<String[]>) session
                    .get(CommonSession.SESSION_ACCOUNT_IDENTITY_TEACHER_CLASSES_LIST);
            tid = (Long) session
                    .get(CommonSession.SESSION_ACCOUNT_IDENTITY_TEACHER_ID);
        }
        // 是学校管理
        st = (Integer) session
                .get(CommonSession.SESSION_ACCOUNT_IDENTITY_SCHOOL);
        if (null != st && 1 == st) {
            sl = (List<String[]>) session
                    .get(CommonSession.SESSION_ACCOUNT_IDENTITY_SCHOOL_LIST);
        }
        // 是代理商
        pt = (Integer) session
                .get(CommonSession.SESSION_ACCOUNT_IDENTITY_PROXY);

        if (null != pt && pt == 1) {
            tl = (List<String[]>) session
                    .get(CommonSession.SESSION_ACCOUNT_IDENTITY_PROXY_LIST);
        }
        
        return SUCCESS;
    }

    public Integer getUt() {
        return ut;
    }

    public Integer getTt() {
        return tt;
    }

    public Integer getHt() {
        return ht;
    }

    public Integer getPt() {
        return pt;
    }

    public Integer getSt() {
        return st;
    }

    public List<String[]> getTl() {
        return tl;
    }

    public List<String[]> getSl() {
        return sl;
    }

    public List<String[]> getTea() {
        return tea;
    }

    public Long getTid() {
        return tid;
    }

    public void setTid(Long tid) {
        this.tid = tid;
    }


}
